package mybatisplusstudydemo.mybatisplusstudydemo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author 小乜
 * @date 2021/10/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    @TableId(type = IdType.ID_WORKER)
    private Long id;

    private String name;
    private Integer age;
    private String email;

    /**
     * create_time
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     *   update_time
     */

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 版本号
     */
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;


    @TableLogic
    private Integer deleted;
//
//    @Version
//    @TableField(fill = FieldFill.INSERT)
//    private Integer version;
//    //版本号
//
//    @TableLogic
//    private Integer deleted;
}
